package com.zzb.dao.impl;

import com.zzb.dao.NewsTypeDao;
import com.zzb.entity.NewsTypeEntity;
import com.zzb.util.MyBatisUtils;

import java.util.List;

public class NewsTypeDaoImpl implements NewsTypeDao {
    @Override
    public NewsTypeEntity findByName(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.findByName(newsTypeEntity);
    }

    @Override
    public int add(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.add(newsTypeEntity);
    }

    @Override
    public int delete(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.delete(newsTypeEntity);
    }

    @Override
    public NewsTypeEntity findById(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.findById(newsTypeEntity);
    }

    @Override
    public List<NewsTypeEntity> findAll(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.findAll(newsTypeEntity);
    }

    @Override
    public int update(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.update(newsTypeEntity);
    }

    @Override
    public int count(NewsTypeEntity newsTypeEntity) {
        NewsTypeDao newsTypeDao = MyBatisUtils.getMapper(NewsTypeDao.class);
        return newsTypeDao.count(newsTypeEntity);
    }
}
